// 车辆管理-车辆列表
import request from '@/utils/request'

// 获取车辆分页数据
export const getVehicle = (params) => {
  return request({
    url: '/manager/truck/page',
    params
  })
}

// 获取已启用车辆
export const getWorkingTrucks = () => {
  return request({
    url: '/manager/workingTrucks'
  })
}
// 获取已停用车辆
export const getUnWorkingTrucks = () => {
  return request({
    url: '/manager/unWorkingTrucks'
  })
}
// 获取车型列表
export const getCarTypeList = () => {
  return request({
    url: '/manager/truckType/simple'
  })
}
// 添加车辆
export const addVehicle = (data) => {
  return request({
    url: '/manager/truck',
    method: 'post',
    data
  })
}
// 获取车辆详情
export const getVehicleDetail = (id) => {
  return request({
    url: `/manager/truck/${id}`
  })
}
// 更新车辆详情
export const editVehicleDetail = (data, id) => {
  return request({
    url: `/manager/truck/${id}`,
    method: 'put',
    data
  })
}
// 改为启用车辆
export const editEnable = (id) => {
  return request({
    url: `/manager/enable/${id}`,
    method: 'put'
  })
}
// 改为停用车辆
export const editDisable = (id) => {
  return request({
    url: `/manager/disable/${id}`,
    method: 'put'
  })
}
// 获取绑定司机
// export const getConfigDriver = (truckId) => {
//   return request({
//     url: `/manager/bindingDrivers/${truckId}`,
//     params: {
//       truckId
//     }
//   })
// }
